<form action="index.php?banhang&module=checkdonhang" method="post" enctype="multipart/form-data" name="themdonhang" >

<!--THONG TIN KHACH HANG-->
<h1>Gửi đơn hàng</h1>
<table width="700" border="0" cellspacing="3">
<!--  <tr>
  	<td>Mã khách hàng</td>
    <td><input type="text" name="makh" id="makh" ></td>
  </tr>-->
  <tr>
  	<td width="170">Thành viên làm đơn</td>
  	<td width="500"><select name="thanhvien" id="thanhvien">
                        <?php $loop = mysql_query("select * from thanhvien where phongban=9");
                                while ($row = mysql_fetch_array($loop))
                                    print "<option value=$row[thanhvienid]>$row[tenthanhvien]</option>";
                        ?></select></td>
  </tr>
  <tr>
  	<td width="170" ><strong>I.Thông tin người đại diện</strong></td>
    <td width="500"></td>
  </tr>
  <tr>
  	<td>Họ và tên đầy đủ</td>
    <td>
    <input class="inputthemdonhang" type="text" name="tenkhachhang">
    <!--<input class="inputthemdonhang" type="text" name="tenkhachhang" id="inputString" onkeyup="lookup(this.value);" onblur="fill();">
        <div class="suggestionsBox" id="suggestions" style="display: none;">
				<h3>Đề xuất: </h3>
				<div class="suggestionList" id="autoSuggestionsList">
					
				</div>
			</div>
    -->
    </td>
  </tr>
  <tr>
  	<td>Số chứng minh thư</td>
    <td><input class="inputthemdonhang" type="text" name="cmt" id="cmt" /></td>
  </tr>
  <tr>
  	<td>Số di dộng</td>
    <td><input class="inputthemdonhang" type="text" name="sdt1" id="sdt1"></td>
  </tr>
  <tr>
    <td>Số máy bàn (nếu có)</td>
    <td><input class="inputthemdonhang" type="text" name="sdt2" id="sdt2" /></td>
    </tr>
      <tr>
    <td>Email</td>
    <td><input class="inputthemdonhang" type="text" name="email" id="email" /></td>
    </tr>
  <tr>
    <td>Giới tính</td>
    <td>
    	<select name="gioitinh" id="gioitinh">
      		<option value="1">Nam</option>
      		<option value="0">Nữ</option>
    	</select>
    </td>
  </tr>
  <tr>
    <td>Ngày sinh</td>
    <td><input type="Text" name="ngaysinh" id="ngaysinh" maxlength="25" size="10" onfocus="this.blur();" class="locked"/>
        <input type="button" value="Chọn ngày" onclick="javascript:NewCssCal('ngaysinh','yyyyMMdd')" />
    </td>
  </tr>
  

<!--THONG TIN DON HANG-->
  <tr>
  	<td><strong>II.Thông tin đơn hàng</strong></td>
  	<td></td>
  </tr>
  <tr>
  	<td>Đơn vị làm áo</td>
    <td><input class="inputthemdonhang" type="text" name="donvilam" id="donvilam"></td>
  </tr>
  <tr>
  	<td>Tính chất</td>
    <td><select class="inputthemdonhang" name="tinhchat" id="tinhchat">
            <?php $loop = mysql_query("select * from tinhchatdonhang");
                    while ($row = mysql_fetch_array($loop))
                        print "<option value=$row[tinhchatid]>$row[loaitinhchat]</option>";
            ?></select>
    </td>
  </tr>
  
  <tr>
    <td>Khuyến mại</td>
    <td colspan="2" >
    <select class="inputthemdonhang" name="khuyenmai" id="khuyenmai">
    					<option value="0">Không khuyến mại</option>
                        <?php $loop = mysql_query("select * from khuyenmai");
                            while ($row = mysql_fetch_array($loop))
                                print "<option value=$row[khuyenmaiid]>$row[tenkhuyenmai], tặng $row[aotangthem] áo cho trên $row[dieukiensoluong] áo ($row[giamgia]% + $row[chuy])</option>";
                            ?></select></td>
  </tr>
  <tr>
  	<td>Số lượng áo</td>
    <td><input type="text" name="soluong" id="soluong" maxlength="4" onfocus="calc_size();" onkeyup="calc_size()" /> (bao gồm cả áo khuyến mại)</td>
  </tr>
  <tr>
  	<td>Trực tiếp/điều phối</td>
    <td><select name="tructiepdieuphoi" id="tructiepdieuphoi">
            <option value="0">Trực tiếp</option>
            <option value="1">Điều phối</option>
        </select>
    </td>
    </tr>
  <tr>
    <td>Ngày gửi đơn hàng</td>
    <td><input type="Text" name="ngayki" id="tDate" maxlength="25" size="10" onfocus="this.blur();" class="locked"/>
    </tr>
  <tr>
<script>

</script>
    <td>Thời gian làm</td>
    <td><select name="lamnhanh" id="lamnhanh" onclick='thoigian();' >
            <option>-- Chọn số ngày --</option>    
            <?php $loop = mysql_query("select * from lamnhanh where tinhtrang=1");
                                while ($row = mysql_fetch_array($loop)){
                                    print "<option value=$row[lamnhanhid]>
                                    $row[thoigianlam] ngày";
                                    if (("$row[themtien]" !=0) && ("$row[themtien]" !=''))
                                        print     ", phụ thu $row[themtien]/áo</option>";
                                }
                        ?>
    </select>
    </td>
  </tr>
  <tr>
    <td>Ngày hoàn thành</td>
    <td><input type="Text" name="ngaytra" id="ngaytra" maxlength="25" size="10" onfocus="this.blur();" class="locked"/>
      </td>
    </tr>
  <tr>
  	<td>Người thiết kế</td>
  	<td><select name="designer" id="designer">
                        <option value="0">Khách tự thiết kế</option>
                        <?php $loop = mysql_query("select * from thanhvien where phongban=7");
                                while ($row = mysql_fetch_array($loop))
                                    print "<option value=$row[thanhvienid]>$row[tenthanhvien]</option>";
                        ?></select></td>
    </tr>

<!--THONG TIN CHI TIET AO-->
  <tr>
  	<td><strong>III.Thông tin chi tiết áo</strong></td>
  	<td></td>
  </tr>
  <tr>
  	<td>Mã vải</td>
    <td>
    	<select name="mavai" id="mavai">
                <option value="">-- Chọn mã --</option>
                <?php $loop = mysql_query("select * from vai");
                        while ($row = mysql_fetch_array($loop))
                            {
                                      print "<option value=$row[vaiid]>$row[mavai] - $row[kieuvai] - còn $row[soluong] áo </option>";                                
                            }
                ?> </select>
    </td>
  </tr>
  <tr>
  	<td>Kiểu cổ áo</td>
    <td>
      		<select name="kieuco" id="kieuco">
                <option value="0" id="cotron" onclick="disable();" >Cổ tròn</option>
                <option value="1" id="cobe" onclick="disable();">Cổ bẻ</option>
            </select>
    </td>
  <tr>
    <td></td>
    <td>
        <div id="chitietcobe" style="background: #F6F6F6; width: 0px; height: 0px; overflow: hidden;"  >
        <table width="200" border="0">
        <tr>
          <td>Cổ</td>
          <td><select name="mauco" id="jumpMenu23">
            <?php include "modules/block-chon-mau.php" ?>
          </select></td>
        </tr>
        <tr>
          <td>Trụ trên</td>
          <td><select name="mautrutren" id="mauco">
            <?php include "modules/block-chon-mau.php" ?>
          </select></td>
        </tr>
        <tr>
          <td>Trụ dưới</td>
          <td><select name="mautruduoi" id="mauco2">
            <?php include "modules/block-chon-mau.php" ?>
          </select></td>
        </tr>
      </table></div>
    </td>
  </tr>
    
<!--CHI TIET THEM-->
  <tr>
  	<td>Chi tiết thêm</td>
    <td><label><input type="checkbox" name="comu" id="comu" onclick="disable();">Có mũ</label>
    			<select name="maumu" style="visibility: hidden;" id="maumu"><?php include 'modules/block-chon-mau.php' ?></select></td>
  </tr>
  <tr>
  	<td></td>
  	<td><label><input type="checkbox" name="taykhacmau" id="taykhacmau" onclick="disable();"/>Tay áo khác màu</label>
    			<select name="mautayao" style="visibility: hidden;" id="mautayao"><?php include 'modules/block-chon-mau.php' ?></select></td>
  </tr>
  <tr>
  	<td></td>
  	<td><label><input type="checkbox" name="intenrieng" id="intenrieng">In tên riêng</label>
  </tr>
  <tr>
  	<td></td>
  	<td><label><input type="checkbox" name="co" id="co" onclick="disable();">Chi tiết cổ</label>
    	<select name="chitietthemco" id="chitietthemco" style="visibility: hidden;">
          <option value="1">Lé</option>
          <option value="2">Bọc</option>
        </select>
      	<select name="mauchitietthemco" id="mauchitietthemco" style="visibility: hidden;">
         <?php include 'modules/block-chon-mau.php' ?>
       	</select></td>
  </tr>
  <tr>
    <td></td>
    <td><label><input type="checkbox" name="tay" id="tay" onclick="disable();">Chi tiết tay</label>
        <select name="chitietthemtay" id="chitietthemtay" style="visibility: hidden;">
          <option value="1">Lé</option>
          <option value="2">Bọc</option>
          <option value="3">Can</option>
        </select>
      <select name="mauchitietthemtay" id="mauchitietthemtay" style="visibility: hidden;">
        <?php include 'modules/block-chon-mau.php' ?>
      </select></td>
    </tr>
  <tr>
    <td></td>
    <td><label><input type="checkbox" name="gau" id="gau" onclick="disable();">Chi tiết gấu</label>
    <select name="chitietthemgau" id="chitietthemgau" style="visibility: hidden;">
      <option value="1">Lé</option>
    </select>
    <select name="mauchitietthemgau" id="mauchitietthemgau" style="visibility: hidden;">
        <?php include 'modules/block-chon-mau.php' ?>
    </select>    </td>
    </tr>
  <tr>
    <td>Chú ý may</td>
    <td colspan="2" >
      <textarea name="chuymay" class="inputthemdonhang"  id="chuymay" cols="45" rows="5"></textarea>
    </td>
  </tr>
  <tr>
    <td>Chú ý in</td>
    <td colspan="2" ><textarea class="inputthemdonhang"  name="chuyin" id="chuyin" cols="45" rows="5"></textarea></td>
  </tr>
  <tr>
    <td>Hình tổng quan</td>
    <td>
      <input class="inputthemdonhang" type="file" name="hinhtongquan" id="hinhtongquan">    </td>
  </tr>
  <tr>
    <td>File chi tiết</td>
    <td><input class="inputthemdonhang"  type="file" name="hinhchitiet" id="hinhchitiet"></td>
  </tr>
  <tr>
    <td>Bảng size (không để trống ô)</td>
    <td><table width="480" border="0" align="left" cellspacing="0">
      <tr>
        <td width="120">Size</td>
        <td width="120" align="center">S</td>
        <td width="120" align="center">M</td>
        <td width="120" align="center">L</td>
        <td width="120" align="center">XL</td>
        <td width="120" align="center">XXL</td>
        <td width="120" align="center">XXXL</td>
        <td width="120" align="center">XXXXL</td>
        <td width="120" align="center">Tổng</td>
      </tr>
      <tr>
        <td>Nam</td>
        <td align="center"><input name="sizenams" class="size" type="text" id="sizenams" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input name="sizenamm" class="size" type="text" id="sizenamm" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input name="sizenaml" class="size" type="text" id="sizenaml" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input name="sizenamxl" class="size" type="text" id="sizenamxl" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input name="sizenamxxl" class="size" type="text" id="sizenamxxl" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input name="sizenamxxxl" class="size" type="text" id="sizenamxxxl" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input name="sizenamxxxxl" class="size" type="text" id="sizenamxxxxl" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input class="locked" name="sizenamtong" type="text" id="sum_m" size="5" maxlength="5" onfocus='this.blur();'></td>
      </tr>
      <tr>
        <td>Nữ</td>
        <td align="center"><input name="sizenus" class="size" type="text" id="sizenus" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input name="sizenum" class="size" type="text" id="sizenum" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input name="sizenul" class="size" type="text" id="sizenul" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input name="sizenuxl" class="size" type="text" id="sizenuxl" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input name="sizenuxxl" class="size" type="text" id="sizenuxxl" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input name="sizenuxxxl" class="size" type="text" id="sizenuxxxl" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input name="sizenuxxxxl" class="size" type="text" id="sizenuxxxxl" size="3" value=0 maxlength="3" onfocus='calc_size();' onkeyup='calc_size();'></td>
        <td align="center"><input class="locked" name="sizenutong" type="text" id="sum_f" size="5" maxlength="5" onfocus='this.blur();'></td>
      </tr>
      <tr>
        <td align="left" colspan="8"><input style="width:410px; background: #CACACA;" type="button" id="dungsai" size="50px;" /></td>
        <td align="center"><input class='locked' name="sizenutong" type="text" id="sum_sum" size="5" maxlength="5" onfocus='this.blur();'></td>
        </tr>
    </table></td>
  </tr>
  
<!--THONG TIN THANH TOAN-->
  <tr>
    <td><strong>IV.Thông tin thanh toán</strong></td>
    <td></td>
  </tr>
  
    <tr><td>Cách tính giá</td><td><input type='text' class="inputthemdonhang" name='chitiettinhgia' id='price_note'></td></tr>
    <tr><td>Đơn giá</td><td><input type='text' name='dongia' id='price' onkeyup='calc_size();'><label id='for_price' name='for_price'></label></td></tr>
    <tr><td>Đã đặt cọc</td><td><input type='text' name='dattruoc' id='mortgage' onkeyup='calc_size();'><label id='for_mortgage' name='for_mortgage'></label></td></tr>
    <tr><td>Tổng giá trị</td><td><input class='locked' type='text' name='tongtien' id='sum' onkeyup='input2string(\"sum\");' onfocus='this.blur();'><label id='for_sum' name='for_sum'></label></td></tr>
    <tr><td>Còn lại</td><td><input class='locked' type='text' name='conlai' id='remain' onkeyup='input2string(\"remain\");' onfocus='this.blur();'><label id='for_remain' name='for_remain'></label></td></tr>
  <tr>
    <td></td>
    <td>
      <input class="button" type="submit" name="submit" value="Gửi đơn hàng" onclick="return confirm('Kiểm tra kĩ chưa? Xem lại đi !')" >
      <input class="button" type="submit" name="submit" value="Lưu tạm" onclick="return alert('Đã lưu')" />    </td>
      <input type="hidden" name="luutam" value="1" />
  </tr>
</table>
</form>